export interface Customer {
  id: string;
  name: string;
  address: string;
  phone: string;
  contact_person?: string;
  business_type?: string;
  location?: {
    longitude: number;
    latitude: number;
  };
  visitDuration?: number; // 预计拜访时长（分钟）
  appointmentTime?: string; // 预约时间
  distance?: number; // 与当前位置的距离（米）
}

export interface Location {
  longitude: number;
  latitude: number;
}

export interface RoutePoint {
  customer: Customer;
  arrivalTime: string;
  departureTime: string;
  travelTime: number; // 从上一个点到这个点的行程时间（分钟）
  travelDistance: number; // 从上一个点到这个点的距离（米）
  travelMethod: string; // 交通方式：driving, walking, transit
  routeDetails?: any; // 详细路线信息，来自高德API
  isLate?: boolean; // 是否迟到
  waitTime?: number; // 等待时间（分钟）
  isScheduled?: boolean; // 是否有预约
}

export interface RoutePlan {
  id: string;
  name: string;
  date: string;
  startLocation: {
    name: string;
    address: string;
    longitude: number;
    latitude: number;
  };
  startTime: string;
  endTime: string;
  totalDistance: number;
  totalDuration: number;
  points: RoutePoint[];
}

export enum RouteOptimizationType {
  SHORTEST_DISTANCE = 'SHORTEST_DISTANCE',
  SHORTEST_TIME = 'SHORTEST_TIME',
  APPOINTMENT_PRIORITY = 'APPOINTMENT_PRIORITY',
}